(global.webpackJsonp = global.webpackJsonp || []).push([ [ "pages/member/address-direct/address-direct" ], {
    "2ecd": function(e, a, n) {},
    "4d53": function(e, a, n) {
        var o = n("2ecd");
        n.n(o).a;
    },
    5225: function(e, a, n) {
        n.d(a, "b", function() {
            return i;
        }), n.d(a, "c", function() {
            return t;
        }), n.d(a, "a", function() {
            return o;
        });
        var o = {
            pickRegions: function() {
                return Promise.all([ n.e("common/vendor"), n.e("components/pick-regions/pick-regions") ]).then(n.bind(null, "dcf4"));
            },
            empty: function() {
                return n.e("components/empty/empty").then(n.bind(null, "6234"));
            }
        }, i = function() {
            this.$createElement, this._self._c;
        }, t = [];
    },
    "64fd": function(e, a, n) {
        n.r(a);
        var o = n("5225"), i = n("6b9d");
        for (var t in i) "default" !== t && function(e) {
            n.d(a, e, function() {
                return i[e];
            });
        }(t);
        n("4d53");
        var d = n("f0c5"), r = Object(d.a)(i.default, o.b, o.c, !1, null, "822ddca8", null, !1, o.a, void 0);
        a.default = r.exports;
    },
    "6b9d": function(e, a, n) {
        n.r(a);
        var o = n("8a7a"), i = n.n(o);
        for (var t in o) "default" !== t && function(e) {
            n.d(a, e, function() {
                return o[e];
            });
        }(t);
        a.default = i.a;
    },
    "8a7a": function(e, a, n) {
        (function(e) {
            Object.defineProperty(a, "__esModule", {
                value: !0
            }), a.default = void 0;
            var o = {
                components: {
                    empty: function() {
                        n.e("components/empty/empty").then(function() {
                            return resolve(n("6234"));
                        }.bind(null, n)).catch(n.oe);
                    },
                    pickRegions: function() {
                        Promise.all([ n.e("common/vendor"), n.e("components/pick-regions/pick-regions") ]).then(function() {
                            return resolve(n("dcf4"));
                        }.bind(null, n)).catch(n.oe);
                    }
                },
                data: function() {
                    return {
                        dataSource: [],
                        buttonTitle: "",
                        content: "",
                        payload: {
                            name: "",
                            phone: "",
                            mobile: "",
                            province: "",
                            city: "",
                            area: "",
							address: "",
							addr: "",
							getAddr: "",
                            lat: "",
							lng: "",
							tc:0,
                            is_default: "0",
                            mode: ""
                        },
						mail_id: "",
						tc:0,
                        defaultRegion: []
                    };
                },
                onLoad: function(a) {
                    var o = this, i = n("54d6");
                    console.log("CHINA_REGIONS", i);
                    var t = (a || {}).type, d = void 0 === t ? "0" : t;
					this.type = d;
					console.log('aaaaaaaaaaa',a);
					var tc = a.tc;
					this.tc = a.tc;
					this.payload.tc = a.tc;

                    var r = "";
                    1 == d ? r = "寄件地址填写" : 2 == d && (r = "收件地址填写"), e.setNavigationBarTitle({
                        title: r
                    }), a.mail_id && (this.mail_id = a.mail_id, this.$api.getUserAreaApi({
                        id: a.mail_id
                    }, function(e) {
                        if ("1" == e.code) {
                            var n = e.data.info, i = {
                                addr_id: a.mail_id,
                                name: n.sender_name,
                                phone: n.sender_phone,
                                mobile: n.sender_mobile,
                                province: n.sender_province,
                                city: n.sender_city,
                                area: n.sender_area,
								address: n.addr,
								addr: n.addr,
								getAddr: n.getAddr,
                                lat: n.lat,
								lng: n.lng,
								tc:a.tc,
                                is_default: n.is_default + "",
                                mode: n.mode
                            };
                            o.payload = i, o.defaultRegion = [ i.province, i.city, i.area ];
                        } else o.$common.errorToShow(e.msg);
                    }));
                },
                onShow: function() {
					this.loadRes();
					this.tc != 9 && this.getClipboardData();
                },
                methods: {
                    onchange: function(e) {
                        var a = e.detail.value;
                        console.log("onchange", a);
                    },
                    onnodeclick: function(e) {
                        console.log("onnodeclick", e);
                    },
                    add1: function(t) {
                      console.log('add1',t);
                      var e = this;
                      wx.chooseLocation({
                            type: "gcj02",
                            success: function(t) {
                                console.log('wx.chooseLocation',t);
                                e.payload.addr = t.name,
                                e.payload.address = t.address,
                                e.payload.lat =  t.latitude,
                                e.payload.lng =  t.longitude
                            }
                        });
                    },
                    handleGetRegion: function(e) {
                        this.payload.province = e[0].name, this.payload.city = e[1].name, this.payload.area = e[2].name;
                    },
                    select: function(a) {
                        "0" !== this.type && (this.$db.set("1" === this.type ? "sendAddr" : "receiptAddr", a), 
                        e.navigateBack());
					},
					getClipboardData: function(a) {
                        var _that = this;
						wx.getClipboardData({
							success: function (res) {
								e.showModal({
									content: "检测到剪切板内容，是否粘贴？",
									success: function(e) {
										_that.content=res.data;
									}
								});
							}
						})
                    },
                    loadRes: function() {
                        var e = this;
                        this.$api.getUserAreaListApi({
                            page: 1,
							limit: 100,
							tc:this.tc,
                            type: this.type
                        }, function(a) {
                            if ("1" == a.code) {
                                var n = a.data.list, o = void 0 === n ? [] : n;
                                e.dataSource = o;
                            } else e.$common.errorToShow(a.msg);
                        });
                    },
                    changeRegion: function(e) {
                        var a = e.detail.value;
                        this.payload.province = a[0], this.payload.city = a[1], this.payload.area = a[2];
                    },
                    aiarea: function() {
                        var e = this;
                        this.content && this.$api.aiareaApi({
                            content: this.content
                        }, function(a) {
                            if ("1" == a.code) {
                                var n = a.data;
								e.payload.name = n.name, 
								e.payload.phone = n.phone,
								e.payload.mobile = n.mobile ? n.mobile : "", 
								e.payload.province = n.province, 
								e.payload.city = n.city, 
								e.payload.area = n.area, 
								e.payload.addr = n.addr, 
								e.payload.address = n.addr, 
								e.payload.getAddr = n.getAddr, 
								e.payload.mode = e.type,
								e.payload.lat = o.lat,
								e.payload.lng = o.lng,
								e.payload.tc = o.tc,
								e.payload.mode = e.type, 
								e.defaultRegion = [ n.province, n.city, n.area ];
                            } else e.$common.errorToShow(a.msg);
                        });
                    },
                    submit: function() {
						console.log('-----this.payload-----',this.payload);
                        var a = this, n = "" == this.mail_id ? this.$api.areaAddApi : this.$api.areaEditApi;
                        if ("" == this.mail_id && (this.payload.mode = this.type), this.payload.address.length >= 45) this.$common.errorToShow("您填写的详细地址超长影响下单，请精简后再提交！"); else if (this.payload.phone || this.payload.mobile) {
                            var o = {
                                name: this.payload.name,
                                province: this.payload.province,
                                city: this.payload.city,
                                area: this.payload.area,
                                lat: this.payload.lat,
								lng: this.payload.lng,
								addr: this.payload.addr,
								getAddr: this.payload.getAddr,
                                address: this.payload.address
                            };
                            this.$common.validate({
                                name: {
                                    name: "联系人姓名"
                                },
                                address: {
                                    name: "详细地址"
                                }
                            }, o) && n(this.payload, function(n) {
                                "1" == n.code ? a.$common.successToShow(n.msg, function() {
                                    a.$db.set("1" == a.type ? "sendAddr" : "receiptAddr", n.data.info), e.navigateBack();
                                }) : a.$common.errorToShow(n.msg);
                            });
                        } else this.$common.errorToShow("手机号码和固定电话二者必填一项！");
                    }
                }
            };
            a.default = o;
        }).call(this, n("543d").default);
    },
    "8e84": function(e, a, n) {
        (function(e) {
            n("98af"), o(n("66fd"));
            var a = o(n("64fd"));
            function o(e) {
                return e && e.__esModule ? e : {
                    default: e
                };
            }
            wx.__webpack_require_UNI_MP_PLUGIN__ = n, e(a.default);
        }).call(this, n("543d").createPage);
    }
}, [ [ "8e84", "common/runtime", "common/vendor" ] ] ]);